You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Preserve download destination until decryption and decompression succeed - #56
FileTransfer.fetchFile now writes decoded downloads to a sibling temporary file, then atomically replaces the destination after the stream closes.
Preserve the destination on decoding, write, close, or move failure and clean up the temporary file before sending any receipt.
Require Files.move(..., REPLACE_EXISTING, ATOMIC_MOVE) with no non-atomic fallback.
Write directly from Joiner without another in-memory payload buffer; keep public signatures and EBICS messages unchanged.
Cover decoding failures, partial writes, close failures, unsupported atomic moves, successful replacement, temporary-file cleanup, and bare relative filenames.
Validation: Java 17, ./mvnw -Dtest=FileTransferTest test (8 tests) and ./mvnw verify (49 tests). The new atomic-move regression fails before this revision and passes after it.
Prepared with AI assistance, with human review before publication. I have six months of top-tier Google model access for research and am investing that opportunity in verified open-source contributions. Related to #54.
Thank you for your help. I think it would be better to write to a temp file in the same directory and then use Files.move(..., REPLACE_EXISTING, ATOMIC_MOVE) to rename to the destination file. This has two advantages: It protects against the case where the disk is full and the file is only partially written. Also Joiner has an internal copy of the data already so we don't need an extra one if we writeTo a temp file.
Thanks @uwemaurer — updated to write directly from Joiner into a sibling temporary file, close the stream, then replace the destination with Files.move(..., REPLACE_EXISTING, ATOMIC_MOVE). There is no non-atomic fallback. Failures clean up the temporary file before any receipt is sent, preserving the original error if cleanup also fails.
Files.createTempFile creates 0600 files on Unix, so replacement uses those permissions rather than retaining the destination’s previous permissions.
Java 17: all 8 focused tests and the full 49-test ./mvnw verify build pass, including partial-write, close, atomic-move failure, cleanup, and relative-path coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FileTransfer.fetchFilenow writes decoded downloads to a sibling temporary file, then atomically replaces the destination after the stream closes.Files.move(..., REPLACE_EXISTING, ATOMIC_MOVE)with no non-atomic fallback.Joinerwithout another in-memory payload buffer; keep public signatures and EBICS messages unchanged.Validation: Java 17,
./mvnw -Dtest=FileTransferTest test(8 tests) and./mvnw verify(49 tests). The new atomic-move regression fails before this revision and passes after it.Prepared with AI assistance, with human review before publication. I have six months of top-tier Google model access for research and am investing that opportunity in verified open-source contributions. Related to #54.